package gwtmodule1.client.gui.salesdept;

import gwtmodule1.client.gui.utils.FormTable;
import gwtmodule1.client.gui.utils.FrameClient;
import gwtmodule1.client.gui.utils.Title;

import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class PageRetexEdit extends VerticalPanel implements FrameClient {

	private Title title = new Title("Create/Edit Return/Exchange Form");

	public PageRetexEdit() {
		super();
		add(title);
		add(createForm());
	}

	private Widget createForm() {
		ListBox customer = new ListBox();
		customer.addItem("Peter Meyer");

		ListBox product = new ListBox();
		product.addItem("Microsoft XBox");

		ListBox status = new ListBox();
		status.addItem("exchanged");

		FormTable table = new FormTable();
		table.addText("Date", "25/02/07");
		table.addInput("Customer", customer);
		table.addInput("Product", product);
		table.addInput("Status", status);
		table.addInput("Description", new TextArea());
		return table;
	}

	public void onShow(Object param) {
		int i = ((Integer) param).intValue();
		title.setTitle((i == 0) ? "Create Return/Exchange Form"
				: "Edit Create Return/Exchange Form");
	}

}
